<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Category extends MY_Controller {

    public function __construct() {
        parent::__construct();
        //Load model
    }

    /**
     * Default function
     */
    public function index($id) {
        //Load albums model
        $this->load->model('albums_m');
        
        if(empty($id)){
            $id = 1;
        }
        
        $params = array(
            'albums.category_id' => $id,
            'albums.status' => 1
        );
        
        //Get album detail
        $arrAlbum = $this->albums_m->get_all_album($params);
        
        //Assign to view
        $this->assign('arrAlbum', $arrAlbum);
        $this->assign('cateID', $id);
        
        //Append script
        $this->addHeadScript(base_url().'static/js/wookmark/jquery.wookmark.min.js');
    }
}